package com.sisgesbyte.web.managedBean.seguridad;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean
@ViewScoped
public class OpcionesControlador implements Serializable{

	private static final long serialVersionUID = 1L;

	private Boolean disabledEdit;
	private Boolean disabledDelete;
	private Boolean disabledUpdate;
	
	@PostConstruct
	private void init(){
		setDisabledDelete(true);
		setDisabledEdit(true);
		setDisabledUpdate(true);
	}
	
	public Boolean getDisabledEdit() {
		return disabledEdit;
	}
	public void setDisabledEdit(Boolean disabledEdit) {
		this.disabledEdit = disabledEdit;
	}
	public Boolean getDisabledDelete() {
		return disabledDelete;
	}
	public void setDisabledDelete(Boolean disabledDelete) {
		this.disabledDelete = disabledDelete;
	}
	public Boolean getDisabledUpdate() {
		return disabledUpdate;
	}
	public void setDisabledUpdate(Boolean disabledUpdate) {
		this.disabledUpdate = disabledUpdate;
	}
	
	public void desactivarControles(){
		setDisabledDelete(true);
		setDisabledEdit(true);
		setDisabledUpdate(true);
		
	}
	public void habilitarControles(Integer lista){

		if(lista > 0){
			setDisabledDelete(false);
			setDisabledEdit(false);
			setDisabledUpdate(false);
		}else{
			setDisabledDelete(true);
			setDisabledEdit(true);
			setDisabledUpdate(true);
		}
	}
	
	public void activarUpdate(){	
		setDisabledUpdate(false);
	}
	

}
